package com.jiepu.daily.corejava.advanceed.part7network.day0812;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @Description:
 * @author: xinjie
 * @date: 2020/8/12  15:29
 */
public class ChatServer6 {
	public static void main(String[] args) {
		int port = 8888;
		try {
			ServerSocket ss = new ServerSocket(port);
			System.out.println("Server started. " + port);
			System.out.println("wait a Client ....");
			// 等待 接受client对象  Client 创建一个 Socket对象。
			while (true) {
				Socket socket = ss.accept();

				BufferedReader br = new BufferedReader(
						new InputStreamReader(socket.getInputStream()));
				PrintWriter pw = new PrintWriter(socket.getOutputStream(), true);
			}


		} catch (IOException e) {
			e.printStackTrace();
		}


	} // main

}
